import request from '@/utils/request'

// 查询兑换记录列表
export function listExchange(query) {
  return request({
    url: '/prod-api/activity/exchange/list',
    method: 'get',
    params: query
  })
}

// 查询兑换记录详细
export function getExchange(exchangeId) {
  return request({
    url: '/prod-api/activity/exchange/' + exchangeId,
    method: 'get'
  })
}

// 新增兑换记录
export function addExchange(data) {
  return request({
    url: '/prod-api/activity/exchange',
    method: 'post',
    data: data
  })
}

// 修改兑换记录
export function updateExchange(data) {
  return request({
    url: '/prod-api/activity/exchange',
    method: 'put',
    data: data
  })
}

// 删除兑换记录
export function delExchange(exchangeId) {
  return request({
    url: '/prod-api/activity/exchange/' + exchangeId,
    method: 'delete'
  })
}


// 修改记录状态
export function updateDataStatus(exchangeId, dataStatus){
  const data = {
    exchangeId,
    dataStatus
  }
  return request({
    url: '/prod-api/activity/exchange/updateDataStatus',
    method: 'put',
    data: data
  })
}
